/*
 * Copyright 2020-2020 yanchangyou
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// This is a generated file. Not intended for manual editing.

package my.lang.parser;

import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiBuilder.Marker;
import static lang.psi.MyLanguageTypes.*;
import static my.lang.parser.MyLanguageParserUtil.*;
import com.intellij.psi.tree.IElementType;
import com.intellij.lang.ASTNode;
import com.intellij.psi.tree.TokenSet;
import com.intellij.lang.PsiParser;
import com.intellij.lang.LightPsiParser;

@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"})
public class MyLanguageParser implements PsiParser, LightPsiParser {

  public ASTNode parse(IElementType type, PsiBuilder builder) {
    parseLight(type, builder);
    return builder.getTreeBuilt();
  }

  public void parseLight(IElementType type, PsiBuilder builder) {
    boolean result;
    builder = adapt_builder_(type, builder, this, null);
    Marker marker = enter_section_(builder, 0, _COLLAPSE_, null);
    result = parse_root_(type, builder);
    exit_section_(builder, 0, marker, type, result, true, TRUE_CONDITION);
  }

  protected boolean parse_root_(IElementType type, PsiBuilder builder) {
    return parse_root_(type, builder, 0);
  }

  static boolean parse_root_(IElementType type, PsiBuilder builder, int level) {
    return myFile(builder, level + 1);
  }

  /* ********************************************************** */
  // subAllExpress | (PAREN_LEFT subAllExpress PAREN_RIGHT)
  public static boolean allExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "allExpress")) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_ALL_EXPRESS, "<all express>");
    result = subAllExpress(builder, level + 1);
    if (!result) result = allExpress_1(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  // PAREN_LEFT subAllExpress PAREN_RIGHT
  private static boolean allExpress_1(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "allExpress_1")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_PAREN_LEFT);
    result = result && subAllExpress(builder, level + 1);
    result = result && consumeToken(builder, MY_PAREN_RIGHT);
    exit_section_(builder, marker, null, result);
    return result;
  }

  /* ********************************************************** */
  // this | identifier
  public static boolean allIdentifier(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "allIdentifier")) return false;
    if (!nextTokenIs(builder, "<all identifier>", MY_IDENTIFIER, MY_THIS)) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_ALL_IDENTIFIER, "<all identifier>");
    result = consumeToken(builder, MY_THIS);
    if (!result) result = consumeToken(builder, MY_IDENTIFIER);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // usi_value |usi_key_name |json_key_name | value
  public static boolean allValue(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "allValue")) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_ALL_VALUE, "<all value>");
    result = consumeToken(builder, MY_USI_VALUE);
    if (!result) result = consumeToken(builder, MY_USI_KEY_NAME);
    if (!result) result = consumeToken(builder, MY_JSON_KEY_NAME);
    if (!result) result = value(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // refExpress ASSIGN allExpress
  public static boolean assignExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "assignExpress")) return false;
    if (!nextTokenIs(builder, "<assign express>", MY_IDENTIFIER, MY_THIS)) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_ASSIGN_EXPRESS, "<assign express>");
    result = refExpress(builder, level + 1);
    result = result && consumeToken(builder, MY_ASSIGN);
    result = result && allExpress(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // assignExpress
  public static boolean assignStatement(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "assignStatement")) return false;
    if (!nextTokenIs(builder, "<assign statement>", MY_IDENTIFIER, MY_THIS)) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_ASSIGN_STATEMENT, "<assign statement>");
    result = assignExpress(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // true|false
  public static boolean boolean_$(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "boolean_$")) return false;
    if (!nextTokenIs(builder, "<boolean $>", MY_FALSE, MY_TRUE)) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_BOOLEAN, "<boolean $>");
    result = consumeToken(builder, MY_TRUE);
    if (!result) result = consumeToken(builder, MY_FALSE);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // statement*
  public static boolean codes(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "codes")) return false;
    Marker marker = enter_section_(builder, level, _NONE_, MY_CODES, "<codes>");
    while (true) {
      int pos = current_position_(builder);
      if (!statement(builder, level + 1)) break;
      if (!empty_element_parsed_guard_(builder, "codes", pos)) break;
    }
    exit_section_(builder, level, marker, true, false, null);
    return true;
  }

  /* ********************************************************** */
  // flow allIdentifier ASSIGN jsonAllExpress
  public static boolean flowDefineStatement(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "flowDefineStatement")) return false;
    if (!nextTokenIs(builder, MY_FLOW)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_FLOW);
    result = result && allIdentifier(builder, level + 1);
    result = result && consumeToken(builder, MY_ASSIGN);
    result = result && jsonAllExpress(builder, level + 1);
    exit_section_(builder, marker, MY_FLOW_DEFINE_STATEMENT, result);
    return result;
  }

  /* ********************************************************** */
  // jsonObjectExpress | jsonArrayExpress
  public static boolean jsonAllExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonAllExpress")) return false;
    if (!nextTokenIs(builder, "<json all express>", MY_BRACE_LEFT, MY_BRACKET_LEFT)) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_JSON_ALL_EXPRESS, "<json all express>");
    result = jsonObjectExpress(builder, level + 1);
    if (!result) result = jsonArrayExpress(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // BRACKET_LEFT allExpress {COMMA allExpress}* BRACKET_RIGHT
  public static boolean jsonArrayExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonArrayExpress")) return false;
    if (!nextTokenIs(builder, MY_BRACKET_LEFT)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_BRACKET_LEFT);
    result = result && allExpress(builder, level + 1);
    result = result && jsonArrayExpress_2(builder, level + 1);
    result = result && consumeToken(builder, MY_BRACKET_RIGHT);
    exit_section_(builder, marker, MY_JSON_ARRAY_EXPRESS, result);
    return result;
  }

  // {COMMA allExpress}*
  private static boolean jsonArrayExpress_2(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonArrayExpress_2")) return false;
    while (true) {
      int pos = current_position_(builder);
      if (!jsonArrayExpress_2_0(builder, level + 1)) break;
      if (!empty_element_parsed_guard_(builder, "jsonArrayExpress_2", pos)) break;
    }
    return true;
  }

  // COMMA allExpress
  private static boolean jsonArrayExpress_2_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonArrayExpress_2_0")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_COMMA);
    result = result && allExpress(builder, level + 1);
    exit_section_(builder, marker, null, result);
    return result;
  }

  /* ********************************************************** */
  // json allIdentifier ASSIGN allExpress
  public static boolean jsonDefineStatement(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonDefineStatement")) return false;
    if (!nextTokenIs(builder, MY_JSON)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_JSON);
    result = result && allIdentifier(builder, level + 1);
    result = result && consumeToken(builder, MY_ASSIGN);
    result = result && allExpress(builder, level + 1);
    exit_section_(builder, marker, MY_JSON_DEFINE_STATEMENT, result);
    return result;
  }

  /* ********************************************************** */
  // serviceJsonExpress | BRACE_LEFT keyValueExpress {COMMA keyValueExpress}* BRACE_RIGHT
  public static boolean jsonObjectExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonObjectExpress")) return false;
    if (!nextTokenIs(builder, MY_BRACE_LEFT)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = serviceJsonExpress(builder, level + 1);
    if (!result) result = jsonObjectExpress_1(builder, level + 1);
    exit_section_(builder, marker, MY_JSON_OBJECT_EXPRESS, result);
    return result;
  }

  // BRACE_LEFT keyValueExpress {COMMA keyValueExpress}* BRACE_RIGHT
  private static boolean jsonObjectExpress_1(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonObjectExpress_1")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_BRACE_LEFT);
    result = result && keyValueExpress(builder, level + 1);
    result = result && jsonObjectExpress_1_2(builder, level + 1);
    result = result && consumeToken(builder, MY_BRACE_RIGHT);
    exit_section_(builder, marker, null, result);
    return result;
  }

  // {COMMA keyValueExpress}*
  private static boolean jsonObjectExpress_1_2(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonObjectExpress_1_2")) return false;
    while (true) {
      int pos = current_position_(builder);
      if (!jsonObjectExpress_1_2_0(builder, level + 1)) break;
      if (!empty_element_parsed_guard_(builder, "jsonObjectExpress_1_2", pos)) break;
    }
    return true;
  }

  // COMMA keyValueExpress
  private static boolean jsonObjectExpress_1_2_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "jsonObjectExpress_1_2_0")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_COMMA);
    result = result && keyValueExpress(builder, level + 1);
    exit_section_(builder, marker, null, result);
    return result;
  }

  /* ********************************************************** */
  // (usi_value |usi_key_name |json_key_name) COLON allExpress
  public static boolean keyValueExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "keyValueExpress")) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_KEY_VALUE_EXPRESS, "<key value express>");
    result = keyValueExpress_0(builder, level + 1);
    result = result && consumeToken(builder, MY_COLON);
    result = result && allExpress(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  // usi_value |usi_key_name |json_key_name
  private static boolean keyValueExpress_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "keyValueExpress_0")) return false;
    boolean result;
    result = consumeToken(builder, MY_USI_VALUE);
    if (!result) result = consumeToken(builder, MY_USI_KEY_NAME);
    if (!result) result = consumeToken(builder, MY_JSON_KEY_NAME);
    return result;
  }

  /* ********************************************************** */
  // codes
  static boolean myFile(PsiBuilder builder, int level) {
    return codes(builder, level + 1);
  }

  /* ********************************************************** */
  // allIdentifier {(DOT allIdentifier)|(BRACKET_LEFT (allValue|refExpress) BRACKET_RIGHT)}*
  public static boolean refExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "refExpress")) return false;
    if (!nextTokenIs(builder, "<ref express>", MY_IDENTIFIER, MY_THIS)) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_REF_EXPRESS, "<ref express>");
    result = allIdentifier(builder, level + 1);
    result = result && refExpress_1(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  // {(DOT allIdentifier)|(BRACKET_LEFT (allValue|refExpress) BRACKET_RIGHT)}*
  private static boolean refExpress_1(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "refExpress_1")) return false;
    while (true) {
      int pos = current_position_(builder);
      if (!refExpress_1_0(builder, level + 1)) break;
      if (!empty_element_parsed_guard_(builder, "refExpress_1", pos)) break;
    }
    return true;
  }

  // (DOT allIdentifier)|(BRACKET_LEFT (allValue|refExpress) BRACKET_RIGHT)
  private static boolean refExpress_1_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "refExpress_1_0")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = refExpress_1_0_0(builder, level + 1);
    if (!result) result = refExpress_1_0_1(builder, level + 1);
    exit_section_(builder, marker, null, result);
    return result;
  }

  // DOT allIdentifier
  private static boolean refExpress_1_0_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "refExpress_1_0_0")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_DOT);
    result = result && allIdentifier(builder, level + 1);
    exit_section_(builder, marker, null, result);
    return result;
  }

  // BRACKET_LEFT (allValue|refExpress) BRACKET_RIGHT
  private static boolean refExpress_1_0_1(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "refExpress_1_0_1")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_BRACKET_LEFT);
    result = result && refExpress_1_0_1_1(builder, level + 1);
    result = result && consumeToken(builder, MY_BRACKET_RIGHT);
    exit_section_(builder, marker, null, result);
    return result;
  }

  // allValue|refExpress
  private static boolean refExpress_1_0_1_1(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "refExpress_1_0_1_1")) return false;
    boolean result;
    result = allValue(builder, level + 1);
    if (!result) result = refExpress(builder, level + 1);
    return result;
  }

  /* ********************************************************** */
  // return allExpress
  public static boolean returnStatement(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "returnStatement")) return false;
    if (!nextTokenIs(builder, MY_RETURN)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_RETURN);
    result = result && allExpress(builder, level + 1);
    exit_section_(builder, marker, MY_RETURN_STATEMENT, result);
    return result;
  }

  /* ********************************************************** */
  // allIdentifier serviceParam
  public static boolean serviceCallExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceCallExpress")) return false;
    if (!nextTokenIs(builder, "<service call express>", MY_IDENTIFIER, MY_THIS)) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_SERVICE_CALL_EXPRESS, "<service call express>");
    result = allIdentifier(builder, level + 1);
    result = result && serviceParam(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // service allIdentifier ASSIGN serviceJsonExpress
  public static boolean serviceDefineStatement(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceDefineStatement")) return false;
    if (!nextTokenIs(builder, MY_SERVICE)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_SERVICE);
    result = result && allIdentifier(builder, level + 1);
    result = result && consumeToken(builder, MY_ASSIGN);
    result = result && serviceJsonExpress(builder, level + 1);
    exit_section_(builder, marker, MY_SERVICE_DEFINE_STATEMENT, result);
    return result;
  }

  /* ********************************************************** */
  // serviceCallExpress
  public static boolean serviceInvokeStatement(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceInvokeStatement")) return false;
    if (!nextTokenIs(builder, "<service invoke statement>", MY_IDENTIFIER, MY_THIS)) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_SERVICE_INVOKE_STATEMENT, "<service invoke statement>");
    result = serviceCallExpress(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // BRACE_LEFT usiExpress {COMMA keyValueExpress}* BRACE_RIGHT
  public static boolean serviceJsonExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceJsonExpress")) return false;
    if (!nextTokenIs(builder, MY_BRACE_LEFT)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_BRACE_LEFT);
    result = result && usiExpress(builder, level + 1);
    result = result && serviceJsonExpress_2(builder, level + 1);
    result = result && consumeToken(builder, MY_BRACE_RIGHT);
    exit_section_(builder, marker, MY_SERVICE_JSON_EXPRESS, result);
    return result;
  }

  // {COMMA keyValueExpress}*
  private static boolean serviceJsonExpress_2(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceJsonExpress_2")) return false;
    while (true) {
      int pos = current_position_(builder);
      if (!serviceJsonExpress_2_0(builder, level + 1)) break;
      if (!empty_element_parsed_guard_(builder, "serviceJsonExpress_2", pos)) break;
    }
    return true;
  }

  // COMMA keyValueExpress
  private static boolean serviceJsonExpress_2_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceJsonExpress_2_0")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_COMMA);
    result = result && keyValueExpress(builder, level + 1);
    exit_section_(builder, marker, null, result);
    return result;
  }

  /* ********************************************************** */
  // PAREN_LEFT [allExpress {COMMA allExpress}*] PAREN_RIGHT
  public static boolean serviceParam(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceParam")) return false;
    if (!nextTokenIs(builder, MY_PAREN_LEFT)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_PAREN_LEFT);
    result = result && serviceParam_1(builder, level + 1);
    result = result && consumeToken(builder, MY_PAREN_RIGHT);
    exit_section_(builder, marker, MY_SERVICE_PARAM, result);
    return result;
  }

  // [allExpress {COMMA allExpress}*]
  private static boolean serviceParam_1(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceParam_1")) return false;
    serviceParam_1_0(builder, level + 1);
    return true;
  }

  // allExpress {COMMA allExpress}*
  private static boolean serviceParam_1_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceParam_1_0")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = allExpress(builder, level + 1);
    result = result && serviceParam_1_0_1(builder, level + 1);
    exit_section_(builder, marker, null, result);
    return result;
  }

  // {COMMA allExpress}*
  private static boolean serviceParam_1_0_1(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceParam_1_0_1")) return false;
    while (true) {
      int pos = current_position_(builder);
      if (!serviceParam_1_0_1_0(builder, level + 1)) break;
      if (!empty_element_parsed_guard_(builder, "serviceParam_1_0_1", pos)) break;
    }
    return true;
  }

  // COMMA allExpress
  private static boolean serviceParam_1_0_1_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "serviceParam_1_0_1_0")) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeToken(builder, MY_COMMA);
    result = result && allExpress(builder, level + 1);
    exit_section_(builder, marker, null, result);
    return result;
  }

  /* ********************************************************** */
  // ( line_comment
  //     | flowDefineStatement
  //     | serviceDefineStatement
  //     | assignStatement
  //     | serviceInvokeStatement
  //     | jsonDefineStatement
  //     | returnStatement
  //     ) {SEMICOLON}*
  public static boolean statement(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "statement")) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_STATEMENT, "<statement>");
    result = statement_0(builder, level + 1);
    result = result && statement_1(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  // line_comment
  //     | flowDefineStatement
  //     | serviceDefineStatement
  //     | assignStatement
  //     | serviceInvokeStatement
  //     | jsonDefineStatement
  //     | returnStatement
  private static boolean statement_0(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "statement_0")) return false;
    boolean result;
    result = consumeToken(builder, MY_LINE_COMMENT);
    if (!result) result = flowDefineStatement(builder, level + 1);
    if (!result) result = serviceDefineStatement(builder, level + 1);
    if (!result) result = assignStatement(builder, level + 1);
    if (!result) result = serviceInvokeStatement(builder, level + 1);
    if (!result) result = jsonDefineStatement(builder, level + 1);
    if (!result) result = returnStatement(builder, level + 1);
    return result;
  }

  // {SEMICOLON}*
  private static boolean statement_1(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "statement_1")) return false;
    while (true) {
      int pos = current_position_(builder);
      if (!consumeToken(builder, MY_SEMICOLON)) break;
      if (!empty_element_parsed_guard_(builder, "statement_1", pos)) break;
    }
    return true;
  }

  /* ********************************************************** */
  // serviceCallExpress | jsonAllExpress | refExpress | allValue | allIdentifier
  public static boolean subAllExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "subAllExpress")) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_SUB_ALL_EXPRESS, "<sub all express>");
    result = serviceCallExpress(builder, level + 1);
    if (!result) result = jsonAllExpress(builder, level + 1);
    if (!result) result = refExpress(builder, level + 1);
    if (!result) result = allValue(builder, level + 1);
    if (!result) result = allIdentifier(builder, level + 1);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

  /* ********************************************************** */
  // usi_key_name COLON usi_value
  public static boolean usiExpress(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "usiExpress")) return false;
    if (!nextTokenIs(builder, MY_USI_KEY_NAME)) return false;
    boolean result;
    Marker marker = enter_section_(builder);
    result = consumeTokens(builder, 0, MY_USI_KEY_NAME, MY_COLON, MY_USI_VALUE);
    exit_section_(builder, marker, MY_USI_EXPRESS, result);
    return result;
  }

  /* ********************************************************** */
  // null|boolean|number|string
  public static boolean value(PsiBuilder builder, int level) {
    if (!recursion_guard_(builder, level, "value")) return false;
    boolean result;
    Marker marker = enter_section_(builder, level, _NONE_, MY_VALUE, "<value>");
    result = consumeToken(builder, MY_NULL);
    if (!result) result = boolean_$(builder, level + 1);
    if (!result) result = consumeToken(builder, MY_NUMBER);
    if (!result) result = consumeToken(builder, MY_STRING);
    exit_section_(builder, level, marker, result, false, null);
    return result;
  }

}
